//
//  FlyNavigationController.m
//  PartyBuildingCloud
//
//  Created by lifayu on 16/9/20.
//  Copyright © 2016年 贵阳飞云科技有限公司. All rights reserved.
//

#import "FlyNavigationController.h"
#import "XOShopTabBarController.h"
@interface FlyNavigationController ()

@end

@implementation FlyNavigationController

+ (void)initialize {
    // 设置全局导航条
    UINavigationBar *bar = [UINavigationBar appearance];
    
    [bar setBackgroundImage:[UIImage fly_imageWithColor:UIColorFromRGB(0xffffff)] forBarMetrics:UIBarMetricsDefault];
    bar.translucent = NO;
    bar.backgroundColor = UIColorFromRGB(0xffffff);
//    bar.shadowImage = [UIImage new];//去掉下面的分割线
    
    // 设置当类的全局导航条标题字体
    NSMutableDictionary *attri = [NSMutableDictionary dictionary];
    attri[NSFontAttributeName] =  [UIFont fontWithName:@"PingFangSC-Medium" size:17];
    attri[NSForegroundColorAttributeName] = UIColorFromRGB(0x3C4151);
    [bar setTitleTextAttributes:attri];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}



- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if(self.viewControllers.count >= 1)
    {
//      if ([viewController isKindOfClass: [XOShopTabBarController class]]) {
//          viewController.navigationItem.backBarButtonItem.image = NULL;
//          viewController.navigationItem.backBarButtonItem.title = @"";
//      }
        viewController.hidesBottomBarWhenPushed = YES;
    }

    [super pushViewController:viewController animated:animated];
}

- (UIViewController *)popViewControllerAnimated:(BOOL)animated
{

    if(self.viewControllers.count == 2)
    {
        self.interactivePopGestureRecognizer.enabled = YES;
    }
    return [super popViewControllerAnimated:animated];
}

@end
